package cn.xuqiudong.console.module.timer.schedule.signin.handler;

import cn.xuqiudong.common.base.craw.CrawlConnect;
import org.jsoup.Connection;

import java.io.IOException;
import java.util.Map;

/**
 * 描述:
 * Ikuuu Vpn 每日签到送流量
 *
 * @author Vic.xu
 * @since 2024-06-24 17:30
 */
public class IkuuuVpnHandler extends AbstractSignInHandler {


    public static void loginAndSign() throws IOException {

        String url = "https://ikuuu.pw/auth/login";
        CrawlConnect connect = CrawlConnect.build(url)
                .header("accept", "application/json, text/javascript, */*; q=0.01")
                .data("host", "ikuuu.pw")
                .data("email", "xuduochoua@163.com")
                .data("passwd", "12122035xx")
                .data("code", "");
        Connection.Response execute = connect.execute();
        LOGGER.info("登录结果:{}", execute.body());
        Map<String, String> cookies = execute.cookies();
        Map<String, String> headers = execute.headers();
        LOGGER.info("IkuuuVpn cookies:{}", cookies);
        LOGGER.info("IkuuuVpn headers:{}", headers);

        String signInUrl = "https://ikuuu.pw/user/checkin";
        Connection.Response execute1 = CrawlConnect.build(signInUrl).header("accept", "application/json, text/javascript, */*; q=0.01").cookie(cookies).header(headers)
                .method(Connection.Method.POST)
                .execute();
        LOGGER.info("IkuuuVpn 每日签到结果:{}", execute1.body());


    }

    public static void main(String[] args) throws IOException {
        loginAndSign();

    }
}
